import React, { useState, useEffect, useRef } from 'react';
import { Table, DatePicker, Select, Button, Modal, message, Radio } from 'antd';

import ProTable from '@ant-design/pro-table';
import styles from './index.less'

import { getHeavyLuggageExcel } from './service'

export default function () {
  const actionRef = useRef();

  const columns = [
    { title: '主批号码', dataIndex: 'orgPlace' },
    { title: '子批号码', dataIndex: 'dstPlace' },
    { title: '代理号', dataIndex: 'a1' },
    { title: '纸质', dataIndex: 'a2' },
    { title: '单类型', dataIndex: 'a3' },
    { title: '纸质单检查', dataIndex: 'a4' },
    { title: '出票日期', dataIndex: 'a5' },
    { title: '旅客类型', dataIndex: 'a7' },
    { title: '补差/变更', dataIndex: 'a8' },
    { title: '关联公司', dataIndex: 'a9' },
    { title: '关联类型', dataIndex: 'a11' },
    { title: '关联票号', dataIndex: 'a22' },
    { title: '关联票联号', dataIndex: 'a33' },
    { title: '库存检查', dataIndex: 'a44' },
    { title: '始发地', dataIndex: 'a55' },
    { title: '目的地', dataIndex: 'a565' },
    { title: '承运人', dataIndex: 'a74' },
    { title: '航班号', dataIndex: 'a711' },
    { title: '飞行日期', dataIndex: 'a222' },
  ]

  const exportExcel = () => {
    console.log(111)
  }
  return (
    <>
      <ProTable
        actionRef={actionRef}
        columns={columns}
        request={params => getHeavyLuggageExcel(params)}
        rowKey="id"
        postData={data => data}
        toolBarRender={() => [
          <div className={styles.btnWrapper}>
            <Button type="primary" onClick={exportExcel}>导出</Button>
          </div>
        ]}
      ></ProTable>
    </>
  );
}
